package freespiritsocial.io.user.weight

import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetBehavior
import freespiritsocial.io.user.R
import me.hgj.jetpackmvvm.base.fragment.BaseBottomSheetDialogFragment

class ReportPostDialog(
    val mContext: Context,
    val callbacks: (Int) -> Unit
): BaseBottomSheetDialogFragment() {


    override fun onCreateView(inflater: LayoutInflater,container: ViewGroup?,savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.dialog_report_post,container,false)

    }

    override fun onViewCreated(view: View,savedInstanceState: Bundle?) {
        super.onViewCreated(view,savedInstanceState)
        init(view)
    }

    private fun init(view: View) = with(view) {
        findViewById<View>(R.id.tv_it_s_inappropriate)?.setOnClickListener {
            callbacks.invoke(2)
            dismiss()
        }
        findViewById<View>(R.id.tv_it_s_spam)?.setOnClickListener {
            callbacks.invoke(1)
            dismiss()
        }

    }
}